import { Navigate } from 'react-router-dom'
import { lazy } from 'react'

import Defaule from '../views/default'

const Report = lazy(() => import('../../src/views/report'))
const History = lazy(() => import('../../src/views/history'))
const Login = lazy(() => import('../../src/views/login'))
const Main = lazy(() => import('../../src/views/main'))

const Home = lazy(() => import('../../src/views/home'))
const Done = lazy(() => import('../../src/views/done'))
const Message = lazy(() => import('../../src/views/message'))
const My = lazy(() => import('../../src/views/my'))

const DataScreen = lazy(() => import('../../src/views/dataScreen'))





const Winnow = lazy(() => import('../../src/views/winnow'))
const PersonalCare = lazy(() => import('../../src/views/personalCare'))





const element = [
	{
		path: 'defaule',
		element: <Defaule />
	},
	{
		path: 'login',
		element: <Login />
	},
	{
		path: 'report',
		element: <Report />
	},
	{
		path: 'history',
		element: <History />
	},
	{
		path: 'dataScreen',
		element: <DataScreen />
	},
	{
		path: 'main',
		element: <Main />,
		children: [
			{
				path: 'home',
				element: <Home />,
			},
			{
				path: 'todo',
				element: <Done />
			},
			{
				path: 'message',
				element: <Message />
			},
			{
				path: 'personalCenter',
				element: <My />
			},
		]
	},
	//严格模式，去掉缺省
	{
		path: '/',
		element: <Navigate to='login' />
	}
]


export default element;
